#!/bin/bash
# common script

TTY_X=$(($(stty size | awk '{print $2}'))) # determine terminal width
TTY_Y=$(($(stty size | awk '{print $1}'))) # determine terminal height

message()
{
	echo ">>>  "$*
}
wait_proc() {
	echo $!
if [[ $2 == "" ]] ;then
	str="Please wait some time"
else
	str=$2
fi
echo $str
while kill -0 $1 2>/dev/null
do
	i=0
	b=''
	while [ $i -le  100 ]
	do
	    printf "[%-50s]%d%%  \r" $b $i
	    sleep 0.01
	    i=`expr 2 + $i`       
	    b=">"$b
	done
	
done
if [ $? -eq 0 ]
then	
  printf "OK.   %-50s \r\n" 
else
  printf "ERROR.%-50s \r\n" 
  exit 1
fi
}
# #############
# clear screen
# #############
clear_screen()
{
	printf "\33c"
}
show_help()
{
	printf "\33c"
	echo "help "
	cat README
	#export
}



